package com.example.springbean.pkg;

import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import javax.servlet.annotation.WebFilter;

@RestControllerAdvice
@WebFilter
public class GlobalExceptionHandler implements WebMvcConfigurer {


    @ExceptionHandler(value = {Exception.class})
    public String getExcption(Exception e) {
        return "error";
    }
}
